{include file="public/nheader"}
<div class="layui-fluid layui-bg-white">
    <form action="{:url()}" class="layui-form layui-form-fixed">
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>公告名称
            </label>
            <div class="layui-input-block">
                <input type="text" name="title" required="" lay-verify="required" autocomplete="off" class="layui-input"
                    value="{$row.title|default=''}" placeholder="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>是否弹窗
            </label>
            <div class="layui-input-block">
                <input type="radio" name="types" value="1" title="否" {if !empty($row.types) &&
                    $row.types==1}checked{/if}>
                <input type="radio" name="types" value="2" title="是" {if !empty($row.types) &&
                    $row.types==2}checked{/if}>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>公告具体内容
            </label>
            <div class="layui-input-block">
                <textarea id="content" name="content" />{$row.content|default=''}</textarea>
            </div>
        </div>
        <div class="layui-footer layui-form-item layui-center ">
            <input type="hidden" value="{$row['id']|default='0'}" name="id" />
            <button class="layui-btn" lay-filter="submitIframe" type="button" lay-submit>提交</button>
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">取消</button>
        </div>
    </form>
</div>
{include file="public/nfooter"}
<script>
    layui.use(['form', 'jquery', 'layedit', 'admin'], function () {
        var form = layui.form;
        var admin = layui.admin;
        var jquery = layui.jquery;
        // 渲染富文本编辑器
        var layedit = layui.layedit;
        var layindex = layedit.build('content');
        // 异步验证表单
        form.verify({
            siteClose: function (value) {
                return layedit.sync(layindex);
            },
        });
    });
</script>